﻿<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>员工管理</title>
    <!-- Bootstrap -->
    <link href="/CSS/bootstrap3.3.5/css/bootstrap.css" rel="stylesheet">
    <link href="/JqueryPlug/dtGrid/jquery.dtGrid.css" rel="stylesheet">
    <link href="/CSS/font-awesome-4.3.0/css/font-awesome.min.css" rel="stylesheet">
    <link href="/CSS/Base/Button.css" rel="stylesheet">

    <script src="/Scripts/jquery-1.11.2.min.js"></script>

    <script type="text/javascript" src="/JqueryPlug/layer/layer/layer.js"></script>
    <script src="/CSS/bootstrap3.3.5/js/bootstrap.js"></script>
    <script src="/Scripts/avalon.js"></script>
    <script src="/Scripts/jquery-migrate-1.1.0.min.js"></script>
    <script src="/JqueryPlug/dtGrid/jquery.dtGrid.js"></script>
    <script src="/Scripts/SZHLCommon.js?jsver=5"></script>
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style type="text/css">
        .dt-grid-headers {
        height:45px;
        }
    </style>
    <script type="text/javascript">
        var grid, dtoption;

        //获取主要菜单
        dtoption = {
            lang: 'zh-cn',
            check: false,
            ajaxLoad: false,
            exportFileName: '应用说明',
            columns: [
                { id: 'ID', title: '编号', type: 'string', columnClass: 'text-center', hide: true },
                { id: 'FormDec', title: '应用', type: 'string', columnClass: 'text-center' },
                {
                    id: 'Opetion', title: '操作', type: 'string', columnClass: 'text-center', resolution: function (value, record, column, grid, dataNo, columnNo) {
                        var content = "<select class='form-control' ><option value='true'>启用</option><option value='false'>关闭</option></select>";
                        return content;
                    }
                },
            {
                id: 'WXAPPCode', title: '对应微信应用', type: 'string', columnClass: 'text-center', resolution: function (value, record, column, grid, dataNo, columnNo) {
                    var content = "<input type='Text'  onblur='Changes(" + dataNo + ",this.value)' class='form-control' value='" + value + "'>";
                    return content;
                }
            },
            { id: 'FormRemark', title: '简要说明', type: 'string', columnClass: 'text-center' }
            ],
            gridContainer: 'dtgrid',
            tools: 'faseQuery',
            onGridComplete: function (grid) {
                var log = '<p>表格加载完成。表格编号：' + grid.option.id + '。</p>';
            }
        };
        function Changes(dataNo, value) {
            dtoption.datas[dataNo].WXAPPCode = value;
        }
        $(function () {
            $.getJSON('/API/SZHLAPI.ashx?Action=GETAPPLIST', function (resultData) {
                if (resultData.ErrorMsg == "") {
                    dtoption.datas = resultData.Result;
                    grid = $.fn.DtGrid.init(dtoption);
                    grid.load()
                }
            })
            $("#btEdit").click(function () {
                var strData = JSON.stringify(dtoption.datas);
                $.post("/API/SZHLAPI.ashx", { Action: "MODIFYAPPINFO", P1: strData },
                   function (result) {
                       if ($.trim(result.ErrorMsg) != "") {
                           ComFunJS.winwarning(result.ErrorMsg);
                       }
                   });
            })
        })

    </script>
</head>
<body>
    <input type="hidden" id="hidBranchId" />
    <div class="container-fluid maindiv" style="margin-top: 20px" id="dvContent">
        <div class="row">
            <div class="col-xs-12"> 
                    <div class="panel-body">

                        <a href="#" id="btEdit" class="btn btn-primary" style="float: right; margin-right:20px; margin-bottom:5px; ">批量提交</a>
                        <div id="dtgrid" style="margin-top:20px"></div>
                        <div id="dtgridTool" class="dt-grid-toolbar-container"></div>
                    </div>
                </div> 
        </div>
    </div>
</body>
</html>